#include "searchthread.h"

SearchThread::SearchThread(QObject *parent) :QThread(parent)
{
    qRegisterMetaType<QVector<Target_Info_Table>>("QVector<Target_Info_Table>");

    sqlitetool = new SQLiteTools(":/autoTarget.db","conn_02");
    sqlitetool->initDataBase();

    api = new TrueApi();
}

SearchThread::~SearchThread()
{
    delete api;
    api = nullptr;

    delete sqlitetool;
    sqlitetool = nullptr;
}

void SearchThread::searchData(int groupNumber, int addr, QString currentDate)
{
    //接收查到的成绩
//    QVector<Target_Info_Table> searchDate = sqlitetool->searchGradeTable(groupNumber,addr,currentDate);



//    for(int i=0;i<searchDate.size();i++){
//        //???
////        emit mySignalSendInfo(api->pushSearchDateApi(searchDate[i]));
//        QByteArray data = api->pushSearchDateApi(searchDate[i]);
//        emit signalSearchData(data);

//        QThread::msleep(100);
//    }
}


